#ifndef RS485_SERIAL_H
#define RS485_SERIAL_H

#include <stdint.h>

struct struct_rs485_serial
{
  void (*open)(void);
  void (*close)(void);
  void (*set_speed)(int);
  int (*set_parity)(int, int, int);
  void (*set_dev)(char *, int);

  int (*read)(uint8_t *data, int size);
  void (*write)(uint8_t *data, int len);
  int  (*check_write)(void);

  int fd;
  char dev[30];
  int send_len;
  int recv_len;

};

extern struct struct_rs485_serial  rs485_ser;

void rs485_ser_init(void);

#endif 

